package com.bi2.events.mobile.adapters;

import com.bi2.events.mobile.R;
import com.bi2.events.mobile.entities.Usuario;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.ArrayList;

public class MuralUsuarioAdapter extends ArrayAdapter<Usuario>{
    private ArrayList<Usuario> items;

    public MuralUsuarioAdapter(Context context, int textViewResourceId, ArrayList<Usuario> items) {
        super(context, textViewResourceId, items);
        this.items = items;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View v = convertView;
        if (v == null) {
            LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = vi.inflate(R.layout.perfil_amigos_row, null);
        }
        Usuario o = items.get(position);
        if (o != null) {
            TextView tt = (TextView) v.findViewById(R.id.mensagem);
           
            if (tt != null) {
                tt.setText("Mensagem: " + o.getNome());
            }
        }
        return v;
    }
}
